package cn.crm.service.impl;

import cn.crm.mapper.CrmPostMapper;
import cn.crm.pojo.CrmPost;
import cn.crm.pojo.CrmPostExample;
import cn.crm.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PostServiceImpl implements PostService {

    @Autowired
    private CrmPostMapper crmPostMapper;

    @Override
    public List<CrmPost> findPostsByDepId(String depId) {
        CrmPostExample example=new CrmPostExample();
        CrmPostExample.Criteria criteria = example.createCriteria();
        criteria.andDepidEqualTo(depId);

        List<CrmPost> crmPosts = crmPostMapper.selectByExample(example);

        return crmPosts;
    }
}
